home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 February / PCWorld_2006-02_cd.bin / software / vyzkuste / tnt / tnt.exe / {app} / plugins / CMD PromptText.ttp < prev    next >
INI File  |  2005-03-15  |  2KB  |  70 lines

  1. [SETTINGS]
  2. Category=Windows Tweaks::System::Command Prompt::Prompt Text
  3. Caption=Prompt Text
  4. version=1.0
  5. Author=
  6. OSVERSION=2000,xp,2003
  7. #=When you start a Command Prompt, it will display a prompt where you can enter the command. This tweak allows you to change the format of the prompt to show additional information instead of just the current drive and path ("C:\>").
  8. #=\n\nSpecial Codes 
  9. #=\n$A - &
  10. #=\n$B - |
  11. #=\n$C - (
  12. #=\n$D - Current date 
  13. #=\n$F - )
  14. #=\n$G - >
  15. #=\n$L - <
  16. #=\n$N - Current drive 
  17. #=\n$P - Current drive and path 
  18. #=\n$Q - =
  19. #=\n$S - space
  20. #=\n$T - Current time 
  21. #=\n$V - Windows XP version number
  22. #=\n$_ - new line
  23. #=\n$$ - $
  24. #=\n\nVariables 
  25. #=\n%USERNAME% - Current Username 
  26. #=\n%COMPUTERNAME% - Local computer name 
  27. #=\n%USERDOMAIN% - Local domain name 
  28. #=\n\nThe default prompt is "$P$G" (i.e, "C:\>"). Some examples: 
  29. #=\n
  30. #=\n[%computername%]$S$P$G to show the computer, drive and path 
  31. #=\n[%username%]$S$P$G to show the current user, drive and path 
  32. #=\n\nTo restore the original value, simply clear the field and hit Apply.
  33.  
  34. [INTERFACE]
  35. type=multi
  36. TYPE0=combo
  37. Text0=Prompt Text
  38.  
  39. [EXPORT]
  40.  
  41. [SCRIPT]
  42. Dim str,arrcode,arrtext
  43. str="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROMPT"
  44.  
  45. Sub OnInit() 
  46.  Dim s
  47.  s=RegReadValue(str)
  48.  SetItemText 0, s
  49.  
  50.  setitemtextex 0,0, "[%computername%]$S$P$G"
  51.  setitemtextex 0,1, "[%username%]$S$P$G"
  52.  
  53. End Sub
  54.  
  55. Sub OnApply(x,y)
  56. Dim s
  57. s = GetItemText(0)
  58. if len(s) then
  59.     RegWriteValue str, s, 4 'reg_expand
  60. else
  61.     RegDeleteVal str
  62. end if
  63. end Sub
  64.  
  65. Sub OnEvent(x,y)
  66. Dim s
  67. s = GetItemText(0)
  68. 'Exe "open", "cmd.exe", "/k PROMPT "&s
  69. End Sub
  70.